//1. 引入 react
import React from 'react';
//2. 引入 react-dom
import ReactDOM from 'react-dom';
//3. 导入 App 组件
import App from './App';
import {BrowserRouter, HashRouter} from 'react-router-dom';
import store from './redux/store';

// Router 路由器
//    * BrowserRouter   常用
//    * HashRouter     
//4. 渲染
ReactDOM.render(
    <HashRouter>
    <App />
    </HashRouter>, document.querySelector("#root"));

store.subscribe(() => {
    ReactDOM.render(
        <HashRouter>
        <App />
        </HashRouter>, document.querySelector("#root"));
});

/**
 * /home   Home
 * /cart   Cart
 * /a      B
 */
